
function My($scope, $http) {
	$scope.showperson = $scope.showlogin = false;
	if (localStorage.account) {
		$scope.showperson = true;
		var url = getUrl("34personCenter");
		var headerJson = getHeader();
		var uid = readData(localStorage.account);
		datas = "id=" + uid;
		$http({
			method: 'POST',
			url: url,
			headers: headerJson,
			timeout: 10000,
			data: datas,
		}).success(function(data, status, headers, config) {
			if (data.code == "0") {
				$scope.my = data.obj;
				tx = data.obj['touxiang'];
				if (!tx) {
					$scope.tx = '../image/my/pl_tp.png'
				} else {
					$scope.tx = tx
				}
			}
		}).error(function() {
			console.log('personal is erro')
		});
	} else {
		$scope.showlogin = true;
	}
}
var lis = document.getElementsByTagName("li");
for (var i = 0; i < lis.length; i++) {
	lis[i].num = i;
	lis[i].onclick = function() {
		if (localStorage.account) {
			openwin(this.num);
		} else {
			login();
		}
	}
}

function openwin(n) {
	switch (n + "") {
		case "0":
			OpenNewWin('orderManager.html', 'shopping/orderManager.html');
			break;
		case "1":
			OpenNewWin('cardBag.html', 'card/cardBag.html');
			break;
		case "2":
			//OpenNewWin('test', 'tishi.html');
			mui.toast("此功能未开放")
			break;
		case "3":
			OpenNewWin('addressList', 'my/addressList.html');
			break;
		case "4":
			OpenNewWin('message.html', 'my/message.html');
			break;
		case "5":
			OpenNewWin('advice.html', 'my/advice.html');
			break;
	}
}

function login() {
	mui.openWindow({
		url: 'my/loginHead.html',
		id: "loginHead.html",
		waiting: {
			autoShow: false
		}
	});

}

function openzhanghao() {
	mui.openWindow({
		id: 'account',
		url: 'my/account.html',
		waiting: {
			autoShow: false
		}
	});

}

function OpenNewWin(sid, surl) {
	mui.openWindow({
		id: sid,
		url: surl,
		waiting: {
			autoShow: false
		}

	});
}
